#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;

int main()
{
	int n;
	cin >> n;
	int xArr[10000];
	int yArr[10000];
	for(int i = 0; i < n; i++)
	{
		cin >> xArr[i] >> yArr[i];	
	} 
	sort(xArr, xArr+n);
	sort(yArr, yArr+n);
	int xMid = xArr[n/2];
	int yMid = yArr[n/2];
	
	int sum = 0;
	for(int i = 0; i < n; i++)
	{
		sum += abs(xMid - xArr[i]) + abs(yMid - yArr[i]);
	}
	cout << sum << endl;
	
	return 0;
}

